<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/11/7
 * Time: 10:23
 */

namespace app\admin\model\user;


use app\common\library\Auth;
use think\Model;

class UserExpertsCategory extends Model
{
    protected $table = 'fa_user_experts_category';
    protected $auth;

    public function __construct($data = [])
    {
        $this->auth = Auth::instance();
        parent::__construct($data);
    }

    public function isExist($c_id)
    {

        if ($this->auth->isLogin()) {
            $where = [
                'uid' => $this->auth->id,
                'c_id' => $c_id,
            ];
            return $this->where($where)->find();
        } else {
            return null;
        }

    }
}